import { Toast, Indicator } from 'mint-ui';
/*
消息提示框
 */
const toastMessage = function (message) {
  Toast({
    message: message,
    position: 'bottom',
    duration: 2000
  });
};

const toastMessageFast = function (message) {
  Toast({
    message: message,
    position: 'bottom',
    duration: 500
  });
};

/*
打开加载效果
 */
const indicatorOpen = function () {
  Indicator.open();
};

/*
关闭加载效果
 */
const indicatorClose = function () {
  Indicator.close();
};

/*
去除首尾字符
 */
const trim = function (str) {
  return str.replace(/^(\s|\u00A0)+/, '').replace(/(\s|\u00A0)+$/, '');
};

export default {
  toastMessage,
  indicatorOpen,
  indicatorClose,
  trim,
  toastMessageFast
};
